package com.kerrykidz.system.util.sync;

import java.util.List;
import java.util.Map;

/**
 * 
 * @Desc 数据同步消息
 * @author QUINN
 * @date 2014年9月16日下午1:57:02
 */
public abstract class SyncMessage extends BaseMessage {

	private static final long serialVersionUID = 1L;

	public SyncMessage(String tableName, String primaryKey, String primaryValue, Map<String, Object> datas) {
		this.tableName = tableName;
		this.primaryKey = primaryKey;
		this.primaryValue = primaryValue;
		this.datas = datas;
	}

	public SyncMessage() {

	}

	protected Map<String, Object> datas;

	public abstract SqlAndParam getInsertSql() throws SyncDataException;

	public abstract SqlAndParam getUpdateSql() throws SyncDataException;

	protected List<RelationMessage> relations;

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public Map<String, Object> getDatas() {
		return datas;
	}

	public void setDatas(Map<String, Object> datas) {
		this.datas = datas;
	}

	public boolean isCommonTable() {
		return isCommonTable;
	}

	public void setCommonTable(boolean isCommonTable) {
		this.isCommonTable = isCommonTable;
	}

	public List<RelationMessage> getRelations() {
		return relations;
	}

	public void setRelations(List<RelationMessage> relations) {
		this.relations = relations;
	}
}
